-
Notifications
You must be signed in to change notification settings - Fork 163
Add proper vkFrameBoundaryANDROID handling #2623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add proper vkFrameBoundaryANDROID handling #2623
Conversation
|
CI gfxreconstruct build queued with queue ID 630626. |
|
CI gfxreconstruct build # 8684 running. |
|
CI gfxreconstruct build # 8684 passed. |
|
CI gfxreconstruct build queued with queue ID 632210. |
|
CI gfxreconstruct build # 8695 running. |
|
CI gfxreconstruct build # 8695 passed. |
5323a9a to
24597c2
Compare
|
CI gfxreconstruct build queued with queue ID 633325. |
|
CI gfxreconstruct build # 8713 running. |
|
CI gfxreconstruct build # 8713 passed. |
24597c2 to
c3de7cb
Compare
|
CI gfxreconstruct build queued with queue ID 634035. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
happy with this now in terms of code-changes.
I did not get to reproduce actual replays using FrameBoundaryANDROID
and we're not adding test-coverage here, since this appears to require a capture-based test.
also I added some changes myself,
so need somebody to have a final look @bradgrantham-lunarg / @MarkY-LunarG :)
|
CI gfxreconstruct build # 8721 running. |
|
CI gfxreconstruct build queued with queue ID 634073. |
|
CI gfxreconstruct build # 8722 running. |
|
CI gfxreconstruct build # 8722 passed. |
|
CI gfxreconstruct build queued with queue ID 635164. |
|
CI gfxreconstruct build # 8736 running. |
|
CI gfxreconstruct build # 8736 passed. |
|
CI gfxreconstruct build queued with queue ID 637687. |
|
CI gfxreconstruct build # 8759 running. |
|
CI gfxreconstruct build # 8759 passed. |
`VulkanSwapchain::CreateSurface` doesn't need that many arguments, as most of them are just forwarding of replay options. In particular some options are badly forwarded (window size), some default value for options are set as constants in the Vulkan swapchain header for no reason etc. This commit tries to clean that a bit to make it more readable and maintainable. Change-Id: If260bc8e112df91815ca0ee7480190e2f28ee587
`vkFrameBoundaryANDROID` is a non-standard Vulkan call (it does not belong to the core nor to any registered extension) used by some Android applications to present a `AHardwareBuffer` to the screen. In particular, Android UI applications present to the screen using this call. Currently, when the call is simply forwarded to the driver when encountered by the replayer. The issue is that this call only actually presents to the screen when a `AHardwareBuffer`-bound image is submitted. However, at replay time, the `AHardwareBuffer` is often (always, as far as I encountered) impossible to recreate in the exact same way - and the issue gets worse when replaying on a different platform. Thus, even if the image is properly rendered and the call forwarded, the screen remains black - even on the exact same device. This commit tries to fix this by considering the `vkFrameBoundaryANDROID` call like an additional `vkQueuePresentKHR` call. The call is treated by the polymorphic `VulkanSwapchain` that decides whether to create a window a present to it (virtual swapchain behavior) or forward the call (offscreen/default swapchain behavior). Change-Id: If3dc05d52824547b14c0fe0c35311d4764c98826
- properly handle multiple devices and allow to cleanup adhoc resources. the VulkanSwapchain::Clean() method override was not possible, because it is invoked after all devices are already destroyed. so this required to add a virtual VulkanSwapchain::CleanDeviceResources(VkDevice) and attach that in VulkanReplayConsumerBase::OverrideDestroyDevice and FreeAllLiveObjects.
1c5d16c to
0730776
Compare
|
CI gfxreconstruct build queued with queue ID 638708. |
|
CI gfxreconstruct build # 8774 running. |
|
CI gfxreconstruct build # 8774 passed. |
This PR is a reduction of #2507 to a more easily reviewable series of commits. It contains only handling of
vkFrameBoundaryANDROIDusing the polymorphic behavior ofVulkanSwapchainand doesn't contain any other type of offscreen frame boundary conversion.vkFrameBoundaryANDROIDis a non-standard Vulkan call (it does not belong to the core nor to any registered extension) used by some Android applications to present aAHardwareBufferto the screen.In particular, Android UI applications present to the screen using this call.
Currently, when the call is simply forwarded to the driver when encountered by the replayer.
The issue is that this call only actually presents to the screen when a
AHardwareBuffer-bound image is submitted. However, at replay time, theAHardwareBufferis often (always, as far as I encountered) impossible to recreate in the exact same way - and the issue gets worse when replaying on a different platform. Thus, even if the image is properly rendered and the call forwarded, the screen remains black - even on the exact same device.This commit tries to fix this by considering the
vkFrameBoundaryANDROIDcall like an additionalvkQueuePresentKHRcall.The call is treated by the polymorphic
VulkanSwapchainthat decides whether to create a window a present to it (virtual swapchain behavior) or forward the call (offscreen/default swapchain behavior).